<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta name="layout" content="main" />
        <title>每月报表查询</title>
    </head>
    <body class='yui-skin-sam'>
        <div class="nav">
            <span class="menuButton"><g:link class="home" controller="management" action="main">返回主菜单</g:link></span>
            <span class="menuButton"><g:link class="list" action="list">库存流水账列表</g:link></span>
        </div>
        <div class="body">
            <h1>每月报表查询</h1>

            <div class="search">
                <g:form action="doEveryMonthProductReport">
                    <g:datePicker name="pickDate" value="${new Date()}" precision="month"/>
                    <input class="save" type="submit" value="搜索" />
                </g:form>
            </div>
            <br>
            <g:if test="${productInstanceList == null}">
                请选择输入的月份
            </g:if>
            <g:else>
            <div class="list">
                <table>
                    <thead>
                        <tr>

                            <g:sortableColumn property="productName" title="产品名称" />

                            <g:sortableColumn property="amount" title="数量" />

                            <g:sortableColumn property="inPrice" title="进价" />

                            <g:sortableColumn property="modelNo" title="型号" />

                            <g:sortableColumn property="outPrice" title="零售价" />

                            <g:sortableColumn property="time" title="进货时间" />

                            <g:sortableColumn property="taskStatus" title="货品情况" />

                            <g:sortableColumn property="id" title="查看"/>

                        </tr>
                    </thead>
                    <tbody>
                        <g:each in="${productInstanceList}" status="i" var="productInstance">

                            <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">

                                <td><g:link action="productDetailList" id="${productInstance.productName}">${fieldValue(bean:productInstance, field:'productName')}</g:link></td>

                                <td>${fieldValue(bean:productInstance, field:'amount')}</td>

                                <td>${fieldValue(bean:productInstance, field:'inPrice')}</td>

                                <td>${fieldValue(bean:productInstance, field:'modelNo')}</td>

                                <td>${fieldValue(bean:productInstance, field:'outPrice')}</td>

                                <td><g:customDateFormat>${fieldValue(bean:productInstance, field:'time')}</g:customDateFormat></td>

                                <td>${fieldValue(bean:productInstance, field:'productFlag')}</td>

                                <td><g:link action="show" id="${productInstance.id}">查看详情</g:link></td>

                            </tr>

                        </g:each>
                    </tbody>
                </table>
                <g:link action="everyMonthProductReportExport" params="[startDate:startDate,endDate:endDate]">导出成Excel</g:link>
            </div>
            </g:else>


        </div>

    </body>
</html>
